//
//  BuyViewController.m
//  LiangYa_BObject
//
//  Created by dllo on 15/10/30.
//  Copyright © 2015年 YuHao. All rights reserved.
//

#import "BuyViewController.h"
#import "CollectShareInBuyView.h"

@interface BuyViewController ()<UIWebViewDelegate>

@property (nonatomic, strong) UIButton *backB;
@property (nonatomic, strong) MBProgressHUD *HUD;

@end

@implementation BuyViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    UIWebView *webV = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, Screenheight)];
    webV.scrollView.bounces = NO;
    webV.delegate = self;
    NSURL *urlPath = [NSURL URLWithString:self.urlStr];
    
    [webV loadRequest:[NSURLRequest requestWithURL:urlPath]];
    
    [self.view addSubview:webV];
    
    self.HUD = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
    
    _HUD.labelText = @"数据加载中...";
    
//    CollectShareInBuyView *csView = [[CollectShareInBuyView alloc] initWithFrame:CGRectMake(0, Screenheight - 49, ScreenWidth, 49)];
//    [self.view addSubview:csView];
    
    // 返回按钮
    self.backB = [UIButton buttonWithType:UIButtonTypeSystem];
    _backB.backgroundColor = [UIColor colorWithRed:1.000 green:0.000 blue:0.139 alpha:1.000];
    _backB.frame = CGRectMake(20, 30, 40, 40);
    _backB.layer.cornerRadius = 20;
    UIImage *backI = [[UIImage imageNamed:@"picture1"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    [_backB setImage:backI forState:UIControlStateNormal];
    [_backB setImageEdgeInsets:UIEdgeInsetsMake(5, 5, 5, 5)];
    [_backB addTarget:self action:@selector(backAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:_backB];
    
    
}

- (void)webViewDidFinishLoad:(UIWebView *)webView
{
    [self.HUD removeFromSuperview];
}

- (void)backAction:(UIButton *)btn
{
    [self dismissViewControllerAnimated:YES completion:^{
        
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
